import HelloWorld1 from './HelloWorld1'
import HelloWorld2 from './HelloWorld2'

const components = {
  HelloWorld1,
  HelloWorld2
}
  
const install = function(Vue, opts = {}) {
  if (install.installed) return;
  Object.keys(components).forEach(key => {
    Vue.component(key, components[key]);
  });
  console.log(opts)
}

// auto install
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
}

export default {
  install,
  ...components
}